package com.aipartner.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 积分订单实体
 *
 * @author AI Partner
 * @since 2025-09-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("credits_orders")
public class CreditsOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 订单ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 订单号
     */
    private String orderNo;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 套餐ID
     */
    private Long packageId;

    /**
     * 套餐名称
     */
    private String packageName;

    /**
     * 积分数量
     */
    private Long creditsAmount;

    /**
     * 订单金额
     */
    private BigDecimal amount;

    /**
     * 实付金额
     */
    private BigDecimal paidAmount;

    /**
     * 支付方式：wechat-微信支付
     */
    private String paymentMethod;

    /**
     * 订单状态：pending-待支付，paid-已支付，cancelled-已取消，failed-支付失败
     */
    private String status;

    /**
     * 第三方订单号
     */
    private String thirdPartyOrderNo;

    /**
     * 第三方交易ID
     */
    private String thirdPartyTransactionId;

    /**
     * 支付时间
     */
    private LocalDateTime paidTime;

    /**
     * 订单过期时间
     */
    private LocalDateTime expireTime;

    /**
     * 积分到期时间
     */
    private LocalDateTime creditsExpireTime;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    private LocalDateTime updateTime;
}
